*************************************************
** Replication File for Synthetic Control Analysis **
** (Section E of the Supporting Information) **
** Title: "Macro Outsourcing: Evaluating Government Reliance on the Private Sector"
** Author: Rachel Augustine Potter
** Journal: The Journal of Politics
** Analysis Data File name: "macrooutsourcing.csv"
** Date: January 2021
** **********************************************



*************************************************
*****E. Synthetic Control Analysis of Wisconsin
*************************************************

/*ssc install synth // for synthetic control analysis
net install synth_runner, from(https://raw.github.com/bquistorff/synth_runner/master/) replace
*/

import delimited "macro.outsourcing.csv"

encode state, gen(state_id)

gen synthetic = 1 
replace synthetic = 0 if nocollbargaining == 1
replace synthetic = 0 if state == "nebraska" | state == "indiana" | state == "connecticut" | state == "michigan" | state == "arkansas"
keep if synthetic ==1

tsset state_id year

gen l1outsourcing = l.outsourcing
gen l2outsourcing = l2.outsourcing
gen lgopsen = l.gopsen
gen lgophouse = l.gophouse
gen lgopgov = l.gopgov
gen ldebtgsp = l.debtgsp
gen lbudget_surplus = l.budget_surplus

**************TABLE E-1: Unit Weights for Wisconsin SCM Study 
synth outsourcing lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus outsourcing(1994)  outsourcing(2001) outsourcing(2006) outsourcing(2010) , trunit(49) trperiod(2011) xperiod(1992(1)2010) nested allopt fig 


**************TABLE E-2: Predictor Balance for Wisconsin Collective Bargaining Study
synth outsourcing lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus outsourcing(1994)  outsourcing(2001) outsourcing(2006) outsourcing(2010) , trunit(49) trperiod(2011) xperiod(1992(1)2010) nested allopt fig 


**************FIGURE E-1: Evaluation of Wisconsin’s Act 10 Using SCM
synth outsourcing lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus outsourcing(1994)  outsourcing(2001) outsourcing(2006) outsourcing(2010) , trunit(49) trperiod(2011) xperiod(1992(1)2010) nested allopt fig 


**************FIGURE E-2: Wisconsin & Peer State Macro Outsourcing Levels
synth_runner outsourcing lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus  outsourcing(1994)  outsourcing(2001) outsourcing(2006) outsourcing(2010), trunit(49) trperiod(2011) keep(`keep') replace gen_var
single_treatment_graphs, trlinediff(-1) raw_gname(outsourcing_raw) effects_gname(outsourcing_effects) effects_ylabels(-10(5)10) effects_ymax(15) effects_ymin(-15) 


**************FIGURE E-3: Probability of SCM Differences Occurring by Chance
synth_runner outsourcing lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus  outsourcing(1994)  outsourcing(2001) outsourcing(2006) outsourcing(2010), trunit(49) trperiod(2011) keep(`keep') replace gen_var
pval_graphs , pvals_gname(outsourcing_pval) pvals_std_gname(outsourcing_pval_t)


**************FIGURE E-4: In-time Placebo Test of Wisconsin’s Collective Bargaining Law
synth outsourcing lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus  outsourcing(1994)  outsourcing(2001) outsourcing(2006) outsourcing(2010) , trunit(49) trperiod(2001) xperiod(1992(1)1999) nested allopt fig


**************FIGURE E-5: In-space Placebo Test for Each State and its Synthetic Control
synth_runner outsourcing lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus  outsourcing(1994)  outsourcing(2001) outsourcing(2006) outsourcing(2010), trunit(49) trperiod(2011) keep(`keep') replace gen_var
single_treatment_graphs, trlinediff(-1) raw_gname(outsourcing_raw) effects_gname(outsourcing_effects) effects_ylabels(-10(5)10) effects_ymax(15) effects_ymin(-15) 
